home *** CD-ROM | disk | FTP | other *** search
/ CD World Haziran 1997 / CD World Haziran 1997.iso / Cesitlemeler / Directx 3.0 / dx3.exe / SDK / SAMPLES / DSSHOW3D / MAINWND.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-28  |  1.7 KB  |  62 lines

  1. #ifndef __MAINWND_H__
  2. #define __MAINWND_H__
  3.  
  4. // Pickup the ASSERT_HWND() macro
  5. #include "DbList.h"
  6.  
  7. class MainWnd
  8. {
  9.     friend LRESULT CALLBACK MainWndProc(HWND, unsigned, WPARAM, LPARAM);
  10. public:
  11.     MainWnd();
  12.     ~MainWnd();
  13.     
  14.     BOOL Create();
  15.     BOOL BatchOpenFiles( PSTR *, int, BOOL, BOOL );
  16.  
  17.     void UpdateStatus( void );
  18.     inline HWND GetHwnd()       { return m_hwnd; }
  19.  
  20.     void DuplicateBuffer( FileInfo *pfiSource );
  21.     void DestroyFileInfo( FileInfo *pfi );
  22.  
  23.     // For convenience, we redefine some global window related functions as
  24.     // members of this class since we can automagically validate and pass the
  25.     // HWND for the class object.
  26.     BOOL UpdateWindow()  { ASSERT_HWND( m_hwnd );
  27.                     return ::UpdateWindow( m_hwnd ); }
  28.     BOOL ShowWindow( int cmdShow )  { ASSERT_HWND( m_hwnd );
  29.                     return ::ShowWindow( m_hwnd, cmdShow ); }
  30.     LRESULT SendMessage( UINT m, WPARAM w, LPARAM l )
  31.         { ASSERT_HWND( m_hwnd ); return ::SendMessage( m_hwnd, m, w, l ); }
  32.     LRESULT PostMessage( UINT m, WPARAM w, LPARAM l )
  33.         { ASSERT_HWND( m_hwnd ); return ::PostMessage( m_hwnd, m, w, l ); }
  34.     int MessageBox( LPCSTR, UINT uType = MB_OK | MB_APPLMODAL );
  35.     int MessageBox( UINT uResID, UINT uType = MB_OK | MB_APPLMODAL );
  36.  
  37. protected:
  38.     void OnDestroy( void );
  39.     BOOL OnCommand( WPARAM, LPARAM );
  40.     BOOL OnTimer( WPARAM, LPARAM );
  41.     BOOL OnPaint( WPARAM, LPARAM );
  42.     BOOL OnDropFiles( WPARAM );
  43.     BOOL OnInitMenu( WPARAM );
  44.  
  45.     FileInfo *OnFileOpen( LPSTR );
  46.  
  47. protected:
  48.     HWND    m_hwnd;
  49.     BOOL    m_fCreated;
  50.     int     m_n3DBuffers;
  51.     DSCAPS  m_dscaps;
  52.     
  53.     DbLinkedList<class FileInfo *>    m_dlInfoList;
  54.  
  55. };
  56.     
  57.  
  58.  
  59. #endif
  60.  
  61.  
  62.